<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>设备事故报告登记</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<link rel="stylesheet" href="${pageContext.request.contextPath }/assets/css/layui.css"  media="all">
	<link rel="stylesheet" href="${pageContext.request.contextPath }/assets/css/toastr.min.css"  media="all">
</head>
<body>
<div class="demoTable" style="padding:10px 0 0 15px">
    <div class="layui-inline">
        <input class="layui-input" name="keyword" id="keyword" placeholder="请输入设备名称" autocomplete="off">
    </div>
    <button class="layui-btn layui-btn-blue" style="margin: 0 0 0 10px" data-type="reload"><i class="layui-icon layui-icon-search">搜索</i></button>
</div>
<table class="layui-hide" id="test" lay-filter="test"></table>
<script type="text/html" id="toolbarDemo">
	<div class="layui-btn-container">
		<button class="layui-btn layui-btn-blue" lay-event="add"><i class="layui-icon layui-icon-add-1">新增</i></button>
		<button class="layui-btn layui-btn-blue" lay-event="delete"><i class="layui-icon layui-icon-delete">批量删除</i></button>
	</div>
</script>
<script type="text/html" id="rowToolbar">
	<%--<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>--%>
	<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
<script src="${pageContext.request.contextPath }/assets/layui.js" charset="utf-8"></script>
<script src="${pageContext.request.contextPath }/assets/layui.all.js"></script>
<script src="${pageContext.request.contextPath }/assets/js/jquery.min.js" charset="utf-8"></script>
<script src="${pageContext.request.contextPath }/assets/js/toastr.min.js" charset="utf-8"></script>
<script type="text/javascript">
layui.use(['table','layer','upload','form'], function(){
	var table = layui.table;
	var layer = layui.layer;
    var laydate = layui.laydate;
    var form = layui.form;
	
	var $ = layui.jquery, active = {
		reload:function () {
            var keyword01 = $("#keyword").val();
            console.log(keyword01)
            table.reload('contenttable',{
                method:'get',
                where:{keyword01:keyword01},
				page: {
					curr: 1
				}
            });
        }
	}
	$('.layui-btn').on('click', function(){
        var type = $(this).data('type');
        active[type] ? active[type].call(this) : '';
    });
	table.render({
	    elem: '#test'
	    ,url:'${pageContext.request.contextPath }/maintResume/queryMaintenanceResume.do'
	    ,toolbar: '#toolbarDemo'
	    ,title: '用户数据表'
	    ,id :'contenttable'
	    ,limits:[10,20,30]
	    ,cols: [[
	      {type: 'checkbox', fixed: 'left'}
	      ,{field:'', title:'序号', sort: true, type:'numbers', width: 60}
	      ,{field:'deviceName', title:'设备名称'}
	      ,{field:'deviceNo', title:'设备编号'}
	      ,{field:'useDept', title:'使用部门'}
	      ,{field:'useMan', title:'使用人'}
	      ,{field:'accidentTime', title:'事故发生时间', templet: function(row){
	    	  if(row.accidentTime == ''){
	    		  return '';
	    	  } else {
	    		  return createTime(row.accidentTime);
	    	  }
	       }}
	      ,{field:'accidentMan', title:'事故责任人'}
          ,{field:'remark01', title:'事故类型'}
	      ,{field:'accidentReason', title:'事故原因'}
	      ,{field:'accidentLoss', title:'事故造成损失'}
	      ,{field:'accidentWay', title:'事故处理方法'}
	      ,{field:'accidentSituation', title:'设备现运行情况'}
	      ,{field:'engineerOpinion', title:'机电工程师意见'}
	      ,{field:'ePrincipal', title:'负责人'}
	      ,{field:'eTime', title:'时间', templet: function(row){ 
	    	  if(row.eTime == ''){
	    		  return '';
	    	  } else {
	    		  return createTime(row.eTime);
	    	  }
	       }}
	      ,{field:'deptOpinion', title:'使用部门意见'}
	      ,{field:'dPrincipal', title:'负责人'}
	      ,{field:'dTime', title:'时间', templet: function(row){ 
	    	  if(row.dTime == ''){
	    		  return '';
	    	  } else {
	    		  return createTime(row.dTime);
	    	  }
	       }}
	      ,{field:'managerOpinion', title:'基地总经理意见'}
	      ,{field:'mPrincipal', title:'负责人'}
	      ,{field:'mTime', title:'时间', templet: function(row){ 
	    	  if(row.mTime == ''){
	    		  return '';
	    	  } else {
	    		  return createTime(row.mTime);
	    	  }
	       }}
	      ,{field:'remark', title:'备注'}
          ,{fixed: 'right', title:'操作', toolbar: '#rowToolbar', align: 'center', width: 110}
	    ]]
	    ,page: true
	});
  
	//头工具栏事件
	table.on('toolbar(test)', function(obj){
		var checkStatus = table.checkStatus(obj.config.id);
	    switch(obj.event){
            case 'add':
                layer.open({
                    type: 1 					//Page层类型
                    ,area: ['760px', '450px'] 	//宽  高
                    ,title: '新增'
                    ,shade: 0.6 				//遮罩透明度
                    ,maxmin: true 				//允许全屏最小化
                    ,anim: 1 					//0-6的动画形式，-1不开启
                    ,content: '<form class="layui-form" id="addformID">'+
						'<div style="border: 1px solid #E6E6E6; margin: 15px 15px; width: 715px">'+
							'<table>'+
								'<tr>'+
									'<td><label class="layui-form-label" style="margin-left:-10px; margin-top:9px">设备编号</label></td>&nbsp;'+
									'<td>'+
										'<div style="">'+
											'<div style="width: 210px; margin-left: 26px; margin-top: 10px; float: left">' +
												'<select class="layui-select" id="deviceNo" name="deviceNo" lay-filter="displayInfo" lay-verify="deviceNo">' +
													'<option value="">请选择</option>' +
												'</select>' +

											'</div>' +
											'<div style="margin-top: 18px; float: left">'+
												'<font style="color:red; font-size: 24px; margin-left: 4px">*</font>'+
											'</div>'+
										'</div>' +
									'</td>'+
									'<td><label class="layui-form-label" style="margin-left:-10px; margin-top:9px">设备名称</label></td>'+
									'<td><input class="layui-input" readonly type="text" id="deviceName" name="deviceName" style="width:210px; margin-top:10px; margin-left:13px; display: inline;">' +
										'<div class="layui-inline" style="margin-top: 4px;">'+
											'<font style="color:red; font-size: 24px; margin-left: 4px">*</font>'+
										'</div>'+
									'</td>'+
								'</tr>'+
								'<tr>'+
									'<td><label class="layui-form-label" style="margin-left:-10px; margin-top:9px">使用部门</label></td>&nbsp;'+
									'<td>'+
										'<div class="layui-input-block" style="width: 210px; margin-top: 10px; margin-left:26px">'+
											'<select class="layui-select" id="useDept" name="useDept" lay-verify="useDept">'+
												'<option value="">请选择</option>'+
											'</select>'+
										'</div>'+
									'</td>'+
									'<td><label class="layui-form-label" style="margin-left:-10px; margin-top:9px">使用人</label></td>'+
									'<td><input class="layui-input" type="text" id="useMan" name="useMan" style="width:210px; margin-top:10px; margin-left:13px; display: inline;"></td>'+
								'</tr>'+
							'</table>'+
							/* '&emsp;&emsp;设备编号&emsp;&emsp;&emsp;<input class="layui-input" type="text" id="deviceNo" name="deviceNo" style="width:230px; display: inline;">'+ */
							/* '&emsp;&emsp;使用部门&emsp;&emsp;&emsp;<input class="layui-input" type="text" id="useDept" name="useDept" value="" style="width:230px; margin-top:15px; display: inline;">'+ */
							'&emsp;&emsp;事故发生时间&emsp;<input class="layui-input" type="text" id="accidentTime" name="accidentTime" style="width:210px; margin-top:15px; display: inline;">'+
							'&emsp;&emsp;&emsp;事故责任人&emsp;<input class="layui-input" type="text" id="accidentMan" name="accidentMan" style="width:210px; margin-top:15px; margin-bottom: 15px; display: inline;">'+
							'<label class="layui-form-label" style="margin-left: -10px">事故类型</label>' +
							'<div class="layui-input-block" style="width:210px; margin-left: 127px">'+
								'<input type="text" class="layui-input" name="remark01" id="remark01" style="position:absolute; z-index:2; width: 182px;" onkeyup="search()" autocomplete="off">'+
								'<select type="text" id="hc_select"  lay-filter="hc_select" autocomplete="off" class="layui-select" lay-search>' +
									'<option value="">请选择</option>'+
									'<option value="重大">重大</option>'+
									'<option value="一般">一般</option>'+
								'</select>'+
							'</div>'+
							'&emsp;&emsp;事故原因&emsp;'+
							'<textarea class="layui-textarea" id="accidentReason" name="accidentReason" style="width: 577px; height: 100px; margin-top: 10px; margin-left: 123px; margin-bottom: 15px"></textarea>'+
							'&emsp;&emsp;事故造成损失&emsp;'+
							'<textarea class="layui-textarea" id="accidentLoss" name="accidentLoss" style="width: 577px; height: 100px; margin-top: 10px; margin-left: 123px; margin-bottom: 15px"></textarea>'+
							'&emsp;&emsp;事故处理方法&emsp;'+
							'<textarea class="layui-textarea" id="accidentWay" name="accidentWay" style="width: 577px; height: 100px; margin-top: 10px; margin-left: 123px; margin-bottom: 15px"></textarea>'+
							'&emsp;&emsp;设备现运行情况&emsp;'+
							'<textarea class="layui-textarea" id="accidentSituation" name="accidentSituation" style="width: 577px; height: 100px; margin-top: 10px; margin-left: 123px; margin-bottom: 15px"></textarea>'+
							'<div style="display: inline; width: 190px; height: 220px; float: left; margin-left: 124px">'+
								'<span style="margin-left: 25px">&emsp;&emsp;机电工程师意见&emsp;</span>'+
								'<textarea class="layui-textarea" id="engineerOpinion" name="engineerOpinion" style="margin-left: 5px; margin-top: 10px; width: 94%"></textarea>'+
								'负责人&nbsp;<input type="text" id="ePrincipal" name="ePrincipal" class="layui-text" style="width: 70%; margin-top: 10px; border: 1px solid #DDDDDD">'+
								'时 间&emsp;<input type="text" id="eTime" name="eTime" class="layui-text" style="width: 70%; margin-top: 10px; border: 1px solid #DDDDDD">'+
							'</div>'+
							'<div style="display: inline; width: 190px; height: 220px; float: left">'+
								'<span style="margin-left: 25px">&emsp;&emsp;使用部门意见&emsp;</span>'+
								'<textarea class="layui-textarea" id="deptOpinion" name="deptOpinion" style="margin-left: 5px; margin-top: 10px; width: 94%"></textarea>'+
								'负责人&nbsp;<input type="text" id="dPrincipal" name="dPrincipal" class="layui-text" style="width: 70%; margin-top: 10px; border: 1px solid #DDDDDD">'+
								'时 间&emsp;<input type="text" id="dTime" name="dTime" class="layui-text" style="width: 70%; margin-top: 10px; border: 1px solid #DDDDDD">'+
							'</div>'+
							'<div style="display: inline; width: 190px; height: 220px; float: left">'+
								'<span style="margin-left: 25px">&emsp;&emsp;基地总经理意见&emsp;</span>'+
								'<textarea class="layui-textarea" id="managerOpinion" name="managerOpinion" style="margin-left: 5px; margin-top: 10px; width: 94%"></textarea>'+
								'负责人&nbsp;<input type="text" id="mPrincipal" name="mPrincipal" class="layui-text" style="width: 70%; margin-top: 10px; border: 1px solid #DDDDDD">'+
								'时 间&emsp;<input type="text" id="mTime" name="mTime" class="layui-text" style="width: 70%; margin-top: 10px; border: 1px solid #DDDDDD">'+
							'</div>'+
							'&emsp;&emsp;备注&emsp;'+
							'<textarea class="layui-textarea" id="remark" name="remark" style="width: 577px; height: 50px; margin-top: 10px; margin-left: 123px; margin-bottom: 15px"></textarea>'+
						'</div>'+
						'<button class="layui-btn layui-btn-blue" id="subBtn" lay-submit lay-filter="addform" style="margin-left:250px; margin-top: 25px; margin-bottom: 25px">提交</button>&emsp;&emsp;&emsp;&emsp;'+
						'<button type="reset" class="layui-btn layui-btn-primary">重置</button>'+
                    '</form>'
                    ,success: function (){
                        //事故发生时间
                        laydate.render({
                            elem: '#accidentTime',
                            type: 'datetime'
                        });
                        //时间1
                        laydate.render({
                            elem: '#eTime',
                            type: 'datetime'
                        });
                        //时间2
                        laydate.render({
                            elem: '#dTime',
                            type: 'datetime'
                        });
                        //时间3
                        laydate.render({
                            elem: '#mTime',
                            type: 'datetime'
                        });
                      	//下拉查找所有设备
                        $.ajax({	
    		  	            type: 'POST',
    		  	            url: '${pageContext.request.contextPath}/device/queryAllDeviceList.do',
    		  	            dataType: 'json',
    		  	            async: false,
    		  	            success: function (data){
    		  	                for (var i = 0; i < data.length; i++) {
    		  	                    $("#deviceNo").append("<option value='"+ data[i].deviceNo +"'>"+ data[i].deviceNo +"</option>");
    		  	                }
    		  	            }
    		  	        });
                      	//下拉框查找所有部门
    					$.ajax({
    			            type: 'POST',
    			            url: '${pageContext.request.contextPath}/device/queryAllDeptList.do',
    			            dataType: 'json',
    			            async: false,
    			            success: function (data){
    			                for (var i = 0; i < data.length; i++) {
    			                    $("#useDept").append("<option value='"+ data[i].name +"'>"+ data[i].name +"</option>");
    			                }
    			            }
    			        });
    					layui.form.render('select');
                    }
                });
            break;
            //批量删除
            case 'delete':
                var data = checkStatus.data;
                var idArr = new Array();
                if(data.length==0){
                    toastr.warning("请至少选择一条记录！");
                }
                for(var i=0;i<data.length;i++){
                    idArr[i] = data[i].id;
                }
                $.ajax({
                    type:'post',
                    url:'${pageContext.request.contextPath }/maintResume/deleteMaintenanceResumeById.do',
                    data:{"idArr" : idArr},
                    success:function(data){
                        layer.confirm('确定删除吗？', function(index){
                        	if(data > 0){
                                toastrStyle();
                                toastr.success("删除成功！");
                                setTimeout(function(){
                                    location.reload();
                                },1000);
                            }else{
                                toastrStyle();
                                toastr.warning("删除失败！");
                                setTimeout(function(){
                                    location.reload();
                                },1000);
                            }
                        });
                    }
                });
            break;
	    };
	});

    //监听行工具事件
    table.on('tool(test)', function(obj){
        var data = obj.data;
        var idArr = new Array();
        /*console.log(obj)*/
        //单个删除
        if(obj.event === 'del'){
            layer.confirm('确定删除吗？', function(index){
                var id = obj.data.id;
                idArr[0] = id;
                $.ajax({
                    type:'post',
                    url:'${pageContext.request.contextPath }/maintResume/deleteMaintenanceResumeById.do',
                    data:{ "idArr" : idArr },
                    success:function(data){
                        if(data > 0){
                            toastrStyle();
                            toastr.success("删除成功！");
                            setTimeout(function(){
                                location.reload();
                            },1000);
                        }else{
                            toastrStyle();
                            toastr.warning("删除失败！");
                            setTimeout(function(){
                                location.reload();
                            },1000);
                        }
                    }
                })
                layer.close(index);
            });
        } else if(obj.event === 'edit'){
            layer.open({
                type: 1 				  //Page层类型
                ,area: ['500px', '450px'] //宽  高
                ,title: '编辑'
                ,shade: 0.6 			  //遮罩透明度
                ,maxmin: true 			  //允许全屏最小化
                ,anim: 1 				  //0-6的动画形式，-1不开启
                ,content: '<form class="layui-form" id="addformID">'+
                    '<div style="border: 1px solid #E6E6E6; margin: 15px 15px; width: 715px">'+
                    '&emsp;&emsp;设备名称&emsp;&emsp;&emsp;<input class="layui-input" type="text" id="deviceName" name="deviceName" style="width:230px; margin-top:15px; display: inline;">'+
                    '&emsp;&emsp;设备编号&emsp;&emsp;<input class="layui-input" type="text" id="deviceNo" name="deviceNo" style="width:230px; display: inline;"><br>'+
                    '&emsp;&emsp;使用部门&emsp;&emsp;&emsp;<input class="layui-input" type="text" id="useDept" name="useDept" value="" style="width:230px; margin-top:15px; display: inline;">'+
                    '&emsp;&emsp;使用人&emsp;&emsp;&emsp;<input class="layui-input" type="text" id="useMan" name="useMan" style="width:230px; margin-top:15px; display: inline;"><br>'+
                    '&emsp;&emsp;事故发生时间&emsp;<input class="layui-input" type="text" id="accidentTime" name="accidentTime" style="width:230px; margin-top:15px; display: inline;">'+
                    '&emsp;&emsp;事故责任人&emsp;<input class="layui-input" type="text" id="accidentMan" name="accidentMan" style="width:230px; margin-top:15px; margin-bottom: 15px; display: inline;">'+
                    '&emsp;&emsp;事故原因&emsp;'+
                    '<textarea class="layui-textarea" id="accidentReason" name="accidentReason" style="width: 577px; height: 100px; margin-top: 10px; margin-left: 123px; margin-bottom: 15px"></textarea>'+
                    '&emsp;&emsp;事故造成损失&emsp;'+
                    '<textarea class="layui-textarea" id="accidentLoss" name="accidentLoss" style="width: 577px; height: 100px; margin-top: 10px; margin-left: 123px; margin-bottom: 15px"></textarea>'+
                    '&emsp;&emsp;事故处理方法&emsp;'+
                    '<textarea class="layui-textarea" id="accidentWay" name="accidentWay" style="width: 577px; height: 100px; margin-top: 10px; margin-left: 123px; margin-bottom: 15px"></textarea>'+
                    '&emsp;&emsp;设备现运行情况&emsp;'+
                    '<textarea class="layui-textarea" id="accidentSituation" name="accidentSituation" style="width: 577px; height: 100px; margin-top: 10px; margin-left: 123px; margin-bottom: 15px"></textarea>'+
                    '<div style="display: inline; width: 190px; height: 220px; float: left; margin-left: 124px">'+
                    '<span style="margin-left: 25px">&emsp;&emsp;机电工程师意见&emsp;</span>'+
                    '<textarea class="layui-textarea" id="engineerOpinion" name="engineerOpinion" style="margin-left: 5px; margin-top: 10px; width: 94%"></textarea>'+
                    '负责人&nbsp;<input type="text" id="ePrincipal" name="ePrincipal" class="layui-text" style="width: 70%; margin-top: 10px; border: 1px solid #DDDDDD">'+
                    '时 间&emsp;<input type="text" id="eTime" name="eTime" class="layui-text" style="width: 70%; margin-top: 10px; border: 1px solid #DDDDDD">'+
                    '</div>'+
                    '<div style="display: inline; width: 190px; height: 220px; float: left">'+
                    '<span style="margin-left: 25px">&emsp;&emsp;使用部门意见&emsp;</span>'+
                    '<textarea class="layui-textarea" id="deptOpinion" name="deptOpinion" style="margin-left: 5px; margin-top: 10px; width: 94%"></textarea>'+
                    '负责人&nbsp;<input type="text" id="dPrincipal" name="dPrincipal" class="layui-text" style="width: 70%; margin-top: 10px; border: 1px solid #DDDDDD">'+
                    '时 间&emsp;<input type="text" id="dTime" name="dTime" class="layui-text" style="width: 70%; margin-top: 10px; border: 1px solid #DDDDDD">'+
                    '</div>'+
                    '<div style="display: inline; width: 190px; height: 220px; float: left">'+
                    '<span style="margin-left: 25px">&emsp;&emsp;基地总经理意见&emsp;</span>'+
                    '<textarea class="layui-textarea" id="managerOpinion" name="managerOpinion" style="margin-left: 5px; margin-top: 10px; width: 94%"></textarea>'+
                    '负责人&nbsp;<input type="text" id="mPrincipal" name="mPrincipal" class="layui-text" style="width: 70%; margin-top: 10px; border: 1px solid #DDDDDD">'+
                    '时 间&emsp;<input type="text" id="mTime" name="mTime" class="layui-text" style="width: 70%; margin-top: 10px; border: 1px solid #DDDDDD">'+
                    '</div>'+
                    '&emsp;&emsp;备注&emsp;'+
                    '<textarea class="layui-textarea" id="remark" name="remark" style="width: 577px; height: 50px; margin-top: 10px; margin-left: 123px; margin-bottom: 15px"></textarea>'+
                    '</div>'+
                    '<button class="layui-btn layui-btn-blue" lay-submit lay-filter="addform" style="margin-left:250px; margin-top: 25px; margin-bottom: 25px">提交</button>&emsp;&emsp;&emsp;&emsp;'+
                    '<button type="reset" class="layui-btn layui-btn-primary">重置</button>'+
                    '</form>'
                ,success: function (){
                    //事故发生时间
                    laydate.render({
                        elem: '#accidentTime',
                        type: 'datetime'
                    });
                    //时间1
                    laydate.render({
                        elem: '#eTime',
                        type: 'datetime'
                    });
                    //时间2
                    laydate.render({
                        elem: '#dTime',
                        type: 'datetime'
                    });
                    //时间3
                    laydate.render({
                        elem: '#mTime',
                        type: 'datetime'
                    });
                }
            });
        }
    });
	/**
     * 表单校验
     */
    form.verify({
    	//value：表单的值、item：表单的DOM对象
    	deviceNo: function(value, item){
    		if(value == ''){
    			return '设备编号不能为空';
    		}
    	},
    	deviceName: function(value, item){
    		if(value == ''){
    			return '设备名称不能为空';
    		}
    	}
    });
    /**
     * 通用表单提交(AJAX方式)（设备事故报告登记）
     */
    form.on('submit(addform)', function (data) {
    	$("#subBtn").attr("disabled",true);
        $.ajax({
            url : '${pageContext.request.contextPath}/maintResume/addMaintenanceResume.do',
            data: $("#addformID").serialize(),
            cache : false,
            type : "post",
        }).done(
            function(res) {
                if (res > 0) {
                    toastrStyle();
                    toastr.success('新增成功！');
                    setTimeout(function(){
                        location.reload();
                    },1000);
                }
            }
        ).fail(
            function(res) {
                toastrStyle();
                toastr.error('新增失败！');
                setTimeout(function(){
                    location.reload();
                },1000);
            }
        )
        return false;
    });
    
  	//查找带回
    form.on('select(displayInfo)', function(data){
    	$.ajax({
            type: 'POST',
            url: '${pageContext.request.contextPath}/device/queryDeviceInfoByNo.do',
            data: {deviceNo:$('#deviceNo').val()},
            /* dataType: 'json', */
            /* async: false, */
            success: function (data){
            	var device = eval('(' +data+ ')');
            	$('#deviceName').val(device.deviceName);
            }
        });
    });

    form.on('select(hc_select)', function (data) {
        $("#remark01").val(data.value);
        $("#hc_select").next().find("dl").css({ "display": "none" });
        form.render();
    });

    window.search = function () {
        var value = $("#remark01").val();
        $("#hc_select").val(value);
        form.render();
        $("#hc_select").next().find("dl").css({ "display": "block" });
        var dl = $("#hc_select").next().find("dl").children();
        var j = -1;
        for (var i = 0; i < dl.length; i++) {
            if (dl[i].innerHTML.indexOf(value) <= -1) {
                dl[i].style.display = "none";
                j++;
            }
            if (j == dl.length-1) {
                $("#hc_select").next().find("dl").css({ "display": "none" });
            }
        }

    }
});
toastr.options.positionClass = 'toast-top-center'; //提示框的位置设置为中上
//提示框样式
function toastrStyle(){
    toastr.options = {
        "closeButton": false,
        "debug": false,
        "newestOnTop": false,
        "progressBar": false,
        "positionClass": "toast-top-center",
        "preventDuplicates": false,
        "onclick": null,
        "showDuration": "5000",
        "hideDuration": "1000",
        "timeOut&quot": "100000",
        "extendedTimeOut": "0",
        "showEasing": "swing",
        "hideEasing": "linear",
        "showMethod": "fadeIn",
        "hideMethod": "fadeOut"
    };
}

//日期格式转换1
function createTime(v){
	var date = new Date(v);
    var y = date.getFullYear();
    var M = date.getMonth()+1;
    M = M<10?'0'+M:M;
    var d = date.getDate();
    d = d<10?("0"+d):d;
    var h = date.getHours();
    h = h<10?("0"+h):h;
    var m = date.getMinutes();
    m = m<10?("0"+m):m;
    var str = y+"-"+M+"-"+d+" "+h+":"+m;
    return str;
}
</script>
</body>
</html>